package com.cy.servlet;

import com.cy.server.Request;
import com.cy.server.Response;

/**
 * @Author ChenYan
 * @Date 2021/8/13 14:16
 * @Description
 */
public abstract class HttpServlet implements Servlet{

    @Override
    public void service(Request request, Response response) {
        if ("GET".equals(request.getMethod())){
            doGet(request, response);
        }
        else {
            doPost(request, response);
        }
    }

    public abstract void doGet(Request request, Response response);

    public abstract void doPost(Request request, Response response);
}
